package com.zd.file.framework.listener;

import com.zd.file.brower.service.ReloadPathService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Component;
import org.springframework.web.util.WebAppRootListener;

import javax.servlet.ServletContextEvent;

@Component
public class WebApplicationListener extends WebAppRootListener {
    static Logger logger = LoggerFactory.getLogger(WebApplicationListener.class);
    @Autowired
    ReloadPathService reloadPathService;

    @Override
    public void contextInitialized(ServletContextEvent event) {
        logger.info("web 服务已启动");
        reloadPathService.reload();
    }
}
